Skip to content

Return dueDate, estimate, and delegate from issues list/search - #73

Open
FelixLisczyk wants to merge 2 commits into
joa23:mainfrom
FelixLisczyk:tl-563
Open

Return dueDate, estimate, and delegate from issues list/search#73
FelixLisczyk wants to merge 2 commits into
joa23:mainfrom
FelixLisczyk:tl-563

Conversation

@FelixLisczyk

Copy link
Copy Markdown
Contributor

Problem

linear issues list and linear search never return an issue's due date, estimate, or delegate, in either text or JSON output — even when the issue has these values set:

linear issues get TL-563 --output json | jq '.dueDate'
# "2026-08-30"

linear issues list --team TL --output json | jq '.[] | select(.identifier=="TL-563") | .dueDate'
# null

issues get reports all three fields correctly, so this is a query-construction gap in the shared SearchIssuesEnhanced GraphQL query used by both issues list and search, not an API limitation or a downstream rendering bug — the text and JSON renderers already handle these fields correctly once present.

Changes

This PR:

  • Adds dueDate, estimate, and delegate { id name email } to the SearchIssuesEnhanced GraphQL query, matching GetIssue's existing selection set.
  • Closes the identical gap in ListAssignedIssues and ListAllIssues, which have the same missing-fields pattern.
  • Adds DueDate, Estimate, and Delegate fields to core.IssueWithDetails and updates ListAllIssues's response decoding and node-to-result mapping, since it decodes into that type rather than core.Issue directly.
  • Updates convertIssueDetails so the three fields survive the IssueWithDetails → core.Issue conversion.
  • Adds a shared CapturingTransport test helper (pkg/linear/testutil) that records the outgoing GraphQL request body, and an assertQueryRequestsFields helper, reused across new regression tests for all three fixed query methods.

No changes were needed in internal/format or the JSON DTO layer — both already handled DueDate/Estimate/Delegate correctly once the query returns them.

Testing

  • make build and make test pass.
  • Manually verified against live Linear data: issues list/search now return dueDate matching issues get for the same issue, in both text and JSON output; issues without a due date continue to omit/null it.
  • Adds HTTP-mock regression tests (pkg/linear/issues/client_test.go) for SearchIssuesEnhanced, ListAssignedIssues, and ListAllIssues, asserting both the outgoing query text and the round-tripped field values (including a populated vs. unpopulated case).
  • Adds a convertIssueDetails unit test (internal/service/issue_convert_test.go) starting from a fully-populated fixture to confirm the fields survive the conversion.

SearchIssuesEnhanced (powering `issues list` and `linear search`)
omitted dueDate, estimate, and delegate from its GraphQL selection
set, so those fields were always null/omitted even though GetIssue's
identical selection returns them fine. Fixed the same gap in
ListAssignedIssues and ListAllIssues, which have the identical
pattern but aren't yet wired into the CLI, and extended
IssueWithDetails/convertIssueDetails so ListAllIssues's fix survives
its conversion to core.Issue. Added HTTP-mock regression tests for
all three query methods, sharing a new CapturingTransport test
helper, to catch this class of bug (a field silently missing from a
query) going forward.
Addresses minor cosmetic discrepancies flagged during plan verification
of the dueDate/estimate/delegate query fix: reorder the new fields in
SearchIssuesEnhanced and ListAllIssues to mirror GetIssue's exact
selection shape, add omitempty consistently to ListAllIssues's pointer
decode fields, and add empty labels fixtures to the unpopulated test
nodes for symmetry with their sibling tests. No behavioral change.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant